<?php $this->load->view('layout/adminHeader'); ?>
    
    <div id="mainContent" class="floatFix">
    	<?php $this->load->view('layout/adminBookingsSubmenu'); ?>
        
    	<div class="lCol">
			<?php $this->load->view('bookings/links',$links_list); ?>		
        	<?php $this->load->view('layout/flashdata'); ?>
            
           	<h2>Step 4 : Confirmation</h2>
			<?php echo validation_errors(); ?>
			<form action="<?php echo site_url("bookings/step4"); ?>" method="post">
				<h3>Tour Details</h3>
					<ul class="displayList">
					   <?php if (isset($booking_tour['tour_name'])) { ?>
						<li class="floatFix">
							<p class="dlLabel">Name:</p>
							<p class="dlContent"><?php  echo $booking_tour['tour_name']; ?>	</p>
						</li>
						<?php } ?>
					   <?php if (isset($booking_tour['departure'])) { ?>
						<li class="floatFix">
							<p class="dlLabel">Departure Date:</p>
							<p class="dlContent"><?php  echo natural_date_for_site($booking_tour['departure'],TRUE); ?>	</p>
						</li>
						<?php } ?>					
					   <?php if( (isset($booking_tour['default_price'])) && (isset($booking_tour['custom_price'])) ){ ?>
						<li class="floatFix">
							<p class="dlLabel">Price:</p>
							<p class="dlContent">
								<?php
								$nb_passengers = count($booking_passengers);
								$price = ($booking_tour['custom_price'] > 0) ? $booking_tour['custom_price'] : $booking_tour['default_price'];
								?>
								
								<table width="50%" border="1">
									<tr>
										<td>
										<?php 
										if($nb_passengers > 1)
											echo $nb_passengers." passengers@ ".$price." each";
										else
											echo $nb_passengers." passenger @ ".$price;
										?>
										</td>
										<td><?php echo $price * $nb_passengers;?></td>
									</tr>
									<tr>
										<td>
											Promotion code <input type="text" name="booking_promo_code" id="booking_promo_code" size="4" value="<?php 
											if(isset($_POST['booking_promo_code'])) echo $_POST['booking_promo_code']; 
											elseif($this->session->userdata('booking_promo_code')) echo $this->session->userdata('booking_promo_code');
											?>"/>
											<input type="button"class="submitButton" name="submit_promo" id="submit_promo" onclick="form.submit()" value=">>" />
										</td>
										<td><?php if(isset($price_off)) echo "- ".$price_off;?> </td>
									</tr>
									<tr>
										<td>Total</td>
										<td><?php 
										if(isset($price_off)) $total = ($price * $nb_passengers) - $price_off;
										else $total = $price * $nb_passengers;
										echo $total;
										?>
										<input type="hidden" value="<?php echo $total;?>" name="booking_total" id="booking_total" /></td>
									</tr>
								</table>
								
							</p>
						</li>
						<?php } ?>						
					</ul>

				<h3>User Details</h3>
					<ul class="displayList">
						<li class="floatFix">
							<p class="dlLabel">First Name:</p>
							<p class="dlContent"><?php if (isset($booking_first_name)) echo $booking_first_name;?>	</p>
						</li>
						<li class="floatFix">
							<p class="dlLabel">Last Name:</p>
							<p class="dlContent"><?php if (isset($booking_last_name)) echo $booking_last_name;?> </p>
						</li>
						<li class="floatFix">
							<p class="dlLabel">Sex:</p>
							<p class="dlContent"><?php if (isset($booking_sex)) echo $booking_sex;?> </p>
						</li>
						<li class="floatFix">
							<p class="dlLabel">Nationality:</p>
							<p class="dlContent"><?php if (isset($booking_nationality)) echo $booking_nationality;?>	</p>
						</li>
						<li class="floatFix">
							<p class="dlLabel">E-mail address:</p>
							<p class="dlContent"><?php if (isset($booking_email)) echo $booking_email;?> </p>
						</li>
						<li class="floatFix">
							<p class="dlLabel">Phone Number:</p>
							<p class="dlContent"><?php if (isset($booking_phone)) echo $booking_phone;?> </p>
						</li>
						<?php if( (isset($booking_address)) && (!empty($booking_address)) ) {?>
						<li class="floatFix">
							<p class="dlLabel">Address:</p>
							<p class="dlContent"><?php echo $booking_address;?> </p>
						</li>
						<?php }?>
						<?php if( (isset($booking_city)) && (!empty($booking_city)) ) {?>
						<li class="floatFix">
							<p class="dlLabel">City:</p>
							<p class="dlContent"><?php echo $booking_city;?>	</p>
						</li>
						<?php }?>
						<?php if( (isset($booking_post_code)) && (!empty($booking_post_code)) ) {?>
						<li class="floatFix">
							<p class="dlLabel">Post Code:</p>
							<p class="dlContent"><?php echo $booking_post_code;?> </p>
						</li>		
						<?php }?>		
						<li class="floatFix">
							<p class="dlLabel">Country:</p>
							<p class="dlContent"><?php if (isset($booking_country)) echo $booking_country;?> </p>
						</li>	
					</ul>	

				<h3>Passengers Details</h3>
				<?php foreach($booking_passengers as $passenger):?>
						 <ul class="displayList">
							<li class="floatFix">
								<p class="dlLabel">First Name:</p>
								<p class="dlContent"><?php echo $passenger['first_name']; ?>	</p>
							</li>
							<li class="floatFix">
								<p class="dlLabel">Last Name:</p>
								<p class="dlContent"><?php echo $passenger['last_name']; ?>	</p>
							</li>						
							<li class="floatFix">
								<p class="dlLabel">Sex:</p>
								<p class="dlContent"><?php echo $passenger['sex']; ?>	</p>
							</li>		
							<li class="floatFix">
								<p class="dlLabel">Nationality:</p>
								<p class="dlContent"><?php echo $passenger['nationality']; ?>	</p>
							</li>		
							<?php if(!empty($passenger['emergency_phone_number'])) {?>						
							<li class="floatFix">
								<p class="dlLabel">Emergency Phone Number:</p>
								<p class="dlContent"><?php echo $passenger['emergency_phone_number']; ?>	</p>
							</li>	
							<?php }?>
							</ul><hr />
				<?php endforeach;?>
				
				<h3>Terms and Conditions</h3>
				<ul class="displayList">
					<li class="floatFix">
						<p class="dlLabel">Accept :</p>
						<p class="dlContent"><input type="checkbox" name="booking_terms" id="booking_terms" value="TRUE" /> </p>
					</li>				
				</ul>
				
				<ul class="formContainer">	
					<li class="floatFix">
						<input type="submit" class="submitButton" value="Confirm >>" name="confirm" id="confirm" />
					</li>
				</ul>
            <form>			
		</div>

        <div class="rCol">
        	<h2>Sidebar</h2>
        </div>
        
    </div>
    
<?php $this->load->view('layout/adminFooter'); ?>